npm install 报错 platform unsupported
node.js 日常报错。
问题
在运行 npm install 的时候又报了这个错,而且还不是第一次了:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16$ cnpm install
platform unsupported babel-loader@7.1.5 › webpack@3.12.0 › watchpack@1.6.0 › chokidar@2.0.4 › fsevents@^1.2.2 Package require os(darwin) not compatible with your platform(win32)
[fsevents@^1.2.2] optional install error: Package require os(darwin) not compatible with your platform(win32)
√ Installed 48 packages
√ Linked 786 latest versions
√ Run 1 scripts
peerDependencies link ajv@5.5.2 in D:\phpStudy\WWW\videowebsite\node_modules\_ajv-keywords@2.1.1@ajv-keywords unmet with D:\phpStudy\WWW\videowebsite\node_modules\ajv(6.5.2)
peerDependencies WARNING dplayer@1.24.0 › mini-css-extract-plugin@0.4.0 requires a peer of webpack@^4.4.0 but webpack@3.12.0 was installed
peerDependencies WARNING dplayer@1.24.0 › webpack-cli@3.0.4 requires a peer of webpack@^4.x.x but webpack@3.12.0 was installed
deprecate autoprefixer@7.2.6 › browserslist@^2.11.3 Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
deprecate css-loader@0.28.11 › cssnano@3.10.0 › postcss-merge-rules@2.1.2 › browserslist@^1.5.2 Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
deprecate webpack-bundle-analyzer@2.13.1 › bfj-node4@^5.2.0 Switch to the `bfj` package for fixes and new features!
Recently updated (since 2018-07-24): 6 packages (detail see file D:\phpStudy\WWW\videowebsite\node_modules\.recently_updates.txt)
Today:
→ copy-webpack-plugin@4.5.2 › cacache@10.0.4 › mississippi@2.0.0 › stream-each@^1.1.0(1.2.3) (01:59:04)
√ All packages installed (964 packages installed from npm registry, used 3m, speed 33.24kB/s, json 834(4.99MB), tarball 0B)
咋一看好像没有出错。
解决问题
将报错的依赖重新安装一下:1
2
3
4
5
6
7cnpm install babel-loader --save
cnpm install
√ Installed 48 packages
√ Linked 0 latest versions
√ Run 0 scripts
√ All packages installed (used 139ms, speed 0B/s, json 0(0B), tarball 0B)
这次重新安装倒是没有出错。